// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "NightSing/CharacterTypes.h"
#include "GameFramework/Actor.h"
#include "Item.generated.h"

class UCapsuleComponent;

//UENUM(BlueprintType)
enum class EItemsState :uint8
{
	EIS_Hovering,
	EAS_Equipped
};

UCLASS()
class NIGHTSING_API AItem : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AItem();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

public:
	UPROPERTY(VisibleAnywhere)
	float RunningTime;

	UPROPERTY(EditAnywhere)
	float Amplitude = 1.f;
	UPROPERTY(EditAnywhere)
	float TimeConstant = 5.f;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
	USkeletalMeshComponent* ItemMesh;

	EItemsState ItemState = EItemsState::EIS_Hovering;
	EWeaponState WeaponState;

	UPROPERTY(VisibleAnywhere)
	UCapsuleComponent* Capsule;

public:
	UFUNCTION(BlueprintPure)
	float TransformedSin();

	UFUNCTION(BlueprintPure)
	float TransformedCos();

	UFUNCTION()
	virtual void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);

	UFUNCTION()
	virtual void OnSphereEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);

	void GetCurrentCharacterState();
	//virtual void SpawnPickupSystem();
	//virtual void SpawnPickupSound();

};
